<?php
/**
* This file holds a class for Application_Model_BusLine.
* @package busmap
*/

/**
* This class holds Application_Model_BusLine class, that manipulates with BusLine objects.
* @package busmap
*/
class Application_Model_BusLine
{
    protected $_name;
    protected $_description;
    protected $_addTime;
    protected $_deleteTime;
    protected $_id;
	protected $_busstops;
	protected $_nrStops;
	protected $_colorId;
 
	/**
	* Constructor with optional options array.
	*/
    public function __construct(array $options = null)
    {
        if (is_array($options)) {
            $this->setOptions($options);
        }
    }
 
	/**
	* Universal setter function that gets a name and a value for the BusLine object property.
	*/
    public function __set($name, $value){
        $method = 'set' . $name;
        if (('mapper' == $name) || !method_exists($this, $method)) {
            throw new Exception('Invalid BusLine property');
        }
        $this->$method($value);
    }

	/**
	* Universal getter function that gets the value of a BusLine property with the given name.
	*/
    public function __get($name){
	       $method = 'get' . $name;
        if (('mapper' == $name) || !method_exists($this, $method)) {
            throw new Exception('Invalid BusLine property');
        }
        return $this->$method();
	}

	/**
	* Setter function for the name property.
	*/
    public function setName($name){
		$this->_name = strval($name);
		return $this;
	}
	/**
	* Getter function for the name property.
	*/
    public function getName(){
		return $this->_name;
	}

	/**
	* Setter function for the busstops property.
	*/
	public function setBusStops($busstops){
		$this->_busstops = $busstops;
		return $this;
	}
	/**
	* Getter function for the busstops property.
	*/
    public function getBusStops(){
		return $this->_busstops;
	}
 
	/**
	* Setter function for the description property.
	*/
    public function setDescription($description){
		$this->_description = strval($description);
		return $this;
	}
	/**
	* Getter function for the description property.
	*/
    public function getDescription(){
		return $this->_description;
	}
 
	/**
	* Setter function for the addTime property.
	*/
    public function setAddTime($ts){
		$this->_addTime = $ts;
		return $this;
	}
	/**
	* Getter function for the addTime property.
	*/
    public function getAddTime(){
		return $this->_addTime;
	}

	/**
	* Setter function for the deleteTime property.
	*/
    public function setDeleteTime($ts){
		$this->_deleteTime = $ts;
		return $this;
	}
	/**
	* Getter function for the deleteTime property.
	*/
    public function getDeleteTime(){
		return $this->_deleteTime;
	}

	/**
	* Setter function for the nrStops (number of busstops that this busline has) property.
	*/
    public function setNrStops($nr){
		$this->_nrStops = $nr;
		return $this;
	}
	/**
	* Getter function for the nrStops property.
	*/
    public function getNrStops(){
		return $this->_nrStops;
	}

	/**
	* Setter function for the colorId (id of the color that this busline is colored with) property.
	*/
    public function setColorId($id){
		$this->_colorId = $id;
		return $this;
	}
	/**
	* Getter function for the colorId property.
	*/
    public function getColorId(){
		return $this->_colorId;
	}
 
	/**
	* Setter function for the id property.
	*/
    public function setId($id){
		$this->_id = $id;
		return $this;
	}
	/**
	* Getter function for the id property.
	*/
    public function getId(){
		return $this->_id;
	}

	/**
	* Function that returns an array with the property values of this object.
	*/
	public function toArray(){
		$returnArray['id'] = $this->_id;
		$returnArray['name'] = $this->_name;
		$returnArray['description'] = $this->_description;
		$returnArray['addTime'] = $this->_addTime;
		$returnArray['deleteTime'] = $this->_deleteTime;
		$returnArray['nrStops'] = $this->_nrStops;
		$returnArray['colorId'] = $this->_colorId;
		return $returnArray;
	}

}
 
